package com.knight.hadoop.day04.mythread.thread.blockingqueue;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

public class TestMain {
	public static void main(String[] args) {
		BlockingQueue<String> queue = new LinkedBlockingQueue<>(2);
		
		Producer producer = new Producer(queue);
		Customer customer = new Customer(queue);
		
		for(int i=0;i<3;i++){
			new Thread(producer,"Producer "+(i+1)).start();
		}
		
		for(int i=0;i<5;i++){
			new Thread(customer,"Customer "+(i+1)).start();
		}
		new Thread(producer,"Producer "+5).start();
	}
}
